<?php
namespace app\console\controller;
use app\model\LeasingCompany as SelfModel;
use app\console\model\Admin;

use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\facade\Request;
use think\facade\Route;
use think\facade\Session;
use think\facade\View;
use think\facade\Db;
use think\facade\Cache;
use think\facade\Cookie;
class LeasingCompany extends Base
{



    public function initialize()
    {
        parent::initialize();
        $this->model = "\app\model\LeasingCompany";
        $this->list_rows = 20;
        $this->where = [['id','in',Session::get('data_id_str')]];

        if(!empty($param['id'])){
            //$where[] = ['id','in',$param['id']];
        }

        
    }

    public function select()
    {
            $admin = Admin::where([['status', '=', 1]])->order(['sort' => 'asc', 'id' => 'desc'])->select()->toArray();
            
            View::assign('admin', $admin);

    }

    /**
     * @return mixed
     * 查询
     */
    public function get_son()
    {
        $param = Request::param();
        $data = $this->model::withSearch(array_keys($param), $param)->lock(true)->order($this->order)->paginate(['query' => $param, 'list_rows' => $this->list_rows])->each(function ($item, $key) {
        });

        $this->select();
        return View::fetch('', ['data' => $data]);
    }

    public function recharge()
    {
        return view();
    }






}